<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <link rel="icon" href="/favicon.ico" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
  <title>Vite App</title>
  <script type="text/javascript">
    ;
    (function (win) {
      var docEl = win.document.documentElement
      var resizeEvent = 'orientationchange' in window ? 'orientationchange' : 'resize'
      var timer

      function refreshRem() {
        var width = docEl.getBoundingClientRect().width || docEl.clientWidth
        if (width > 750) {
          width = 750
        }
        var rem = width / 10 // 将屏幕宽度分成10份，1份为1rem
        docEl.style.fontSize = rem + 'px'
      }
      refreshRem()
      win.addEventListener(
        resizeEvent,
        function () {
          clearTimeout(timer)
          timer = setTimeout(refreshRem, 300)
        },
        false
      )
    })(window)
  </script>
</head>

<body>
  <div id="app"></div>
  <script type="module" src="/src/main.ts"></script>
</body>

</html>